# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libpinyin
pkgver=2.6.2
pkgrel=0
pkgdesc="Library to deal with pinyin"
url="https://github.com/libpinyin/libpinyin"
# armhf blocked by kyotocabinet
# s390x blocked due to failing tests
arch="all !armhf !s390x"
license="GPL-3.0-or-later"
depends_dev="kyotocabinet-dev"
makedepends="$depends_dev
	autoconf
	automake
	glib-dev
	libtool
	"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://downloads.sourceforge.net/project/libpinyin/libpinyin/libpinyin-$pkgver.tar.gz"
options="!check" # Flaky tests, succeeding on CI but failing on builders

build() {
	./configure \
		--prefix=/usr \
		--enable-libzhuyin \
		--with-dbm=KyotoCabinet
	make
}

check() {
	make check
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="
42d252f4b3109a60981b7c9a619be5fa49a4b247cbfed71591f844083fec4d1ea067aef2ac608801fd2a12188ff081b4e9aab1f27e9efed84a10d5c9151368bb  libpinyin-2.6.2.tar.gz
"
